package info.javafans.database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DatabaseManager {

	public Connection getConnection() {
		Connection connection = null;

		try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException e) {
			System.out.println("info.javafans: Can't find driver!");
			e.printStackTrace();
		}
		String url = "jdbc:mysql://127.0.0.1:3306/jblog?characterEncoding=UTF-8&amp;characterSetResults=UTF-8";
		try {
			connection = DriverManager.getConnection(url, "root", "");
		} catch (SQLException e) {
			System.out.println("info.javafans: Can't connect to database");
		}

		return connection;
	}

}
